Added Unit Testing, Larastan and Coverage#2
Conversation
- larastan
There was a problem hiding this comment.
Pull Request Overview
This PR adds unit tests, integrates Larastan for static analysis, and updates the CI pipeline to enforce code quality and test coverage. Key changes include new test actions for runnable and dispatchable actions, modifications to stub and trait files to use readonly classes, and updates to the composer and CI configuration.
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Setup/Actions/DoRunnableAction.php | Introduces a new test action using the IsRunnable trait |
| tests/Setup/Actions/DoDispatchableAction.php | Introduces a new test action using the IsDispatchable trait |
| tests/Pest.php | Sets up the testing framework configuration |
| stubs/dto.stub | Updates stub file to declare classes as readonly |
| src/Traits/IsRunnable.php | Adjusts the return value of the run method |
| src/Conversion/DataConverter.php | Removes the check for a field allowing null values, potentially affecting missing data handling |
| src/Console/BaseStubCommand.php | Changes several methods to abstract definitions and removes the force option check in file creation |
| src/Attributes/* | Updates attribute classes to readonly |
| src/Analysis/FieldMetadata.php | Changes FieldMetadata from having readonly properties to normal properties within a readonly class |
| src/Analysis/ClassMetadata.php | Removes helper methods and updates readonly property declarations |
| phpunit.xml.dist, phpstan.neon.dist, composer.json, .github/workflows/pr.yml | Updates and reorders configurations for testing, static analysis, and CI |
Comments suppressed due to low confidence (3)
src/Conversion/DataConverter.php:50
- The removal of the check for $field->allowsNull may cause missing data to be handled incorrectly. Consider restoring this condition to return null when the field allows null values.
if ($field->allowsNull) {
src/Console/BaseStubCommand.php:78
- Removing the force option check (i.e. ! $this->option('force')) prevents bypassing the file existence check. Reintroduce the force option to allow developers to override file existence when needed.
if (File::exists($path)) {
src/Analysis/FieldMetadata.php:8
- [nitpick] Changing properties from explicitly readonly to mutable in a readonly class may break immutability guarantees. Confirm that this change is intentional and aligned with the desired API design.
public string $propertyName,
|
CI Pipeline Failed Please address these issues before merging. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
No description provided.